```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>HotSpot JVM 垃圾收集器详解 | 技术小馆</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 700;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .icon-circle {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto;
        }
        .feature-icon {
            font-size: 1.5rem;
        }
        .timeline:before {
            content: '';
            position: absolute;
            left: 50%;
            top: 0;
            bottom: 0;
            width: 2px;
            background: #e2e8f0;
            transform: translateX(-50%);
        }
        .timeline-dot {
            width: 16px;
            height: 16px;
            border-radius: 50%;
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            top: 24px;
        }
        .comparison-item {
            transition: all 0.3s ease;
        }
        .comparison-item:hover {
            background-color: #f8fafc;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <header class="hero-gradient text-white py-16 md:py-24 px-4">
        <div class="container mx-auto max-w-6xl text-center">
            <h1 class="text-4xl md:text-5xl font-bold mb-4 animate-fade-in">HotSpot JVM 垃圾收集器深度解析</h1>
            <p class="text-xl md:text-2xl mb-8 max-w-3xl mx-auto opacity-90">探索 Java 虚拟机中不同垃圾收集器的核心机制与最佳实践</p>
            <div class="flex justify-center space-x-4">
                <a href="#comparison" class="px-6 py-3 bg-white text-indigo-700 rounded-full font-medium hover:bg-opacity-90 transition duration-300 transform hover:scale-105">
                    <i class="fas fa-balance-scale-left mr-2"></i>收集器对比
                </a>
                <a href="#timeline" class="px-6 py-3 bg-indigo-800 bg-opacity-30 text-white rounded-full font-medium hover:bg-opacity-50 transition duration-300 transform hover:scale-105">
                    <i class="fas fa-history mr-2"></i>发展历程
                </a>
            </div>
        </div>
    </header>

    <!-- Introduction Section -->
    <section class="py-12 px-4">
        <div class="container mx-auto max-w-6xl">
            <div class="bg-white rounded-xl shadow-md p-8 md:p-10">
                <div class="flex items-center mb-6">
                    <div class="bg-indigo-100 rounded-full p-3 mr-4">
                        <i class="fas fa-recycle text-indigo-600 text-xl"></i>
                    </div>
                    <h2 class="text-2xl font-bold text-gray-800">垃圾收集器概述</h2>
                </div>
                <p class="text-gray-700 mb-6">HotSpot JVM 提供了多种垃圾收集器，每种垃圾收集器都有其独特的设计目标和适用场景。选择合适的垃圾收集器取决于应用程序的需求，包括吞吐量、延迟、内存使用模式等。理解这些垃圾收集器的特点和工作机制可以帮助优化应用程序的性能和资源利用。</p>
                
                <div class="mermaid mb-6">
                    graph TD
                    A[垃圾收集器] --> B(串行收集器)
                    A --> C(并行收集器)
                    A --> D(CMS收集器)
                    A --> E(G1收集器)
                    A --> F(ZGC)
                    A --> G(Shenandoah)
                    B -->|单线程| H[低开销]
                    C -->|多线程| I[高吞吐]
                    D -->|并发| J[低延迟]
                    E -->|分区| K[平衡]
                    F -->|并发| L[极低延迟]
                    G -->|并发| M[低停顿]
                </div>
                
                <p class="text-gray-700">本指南将详细介绍每种垃圾收集器的工作原理、适用场景和配置建议，帮助您为应用选择最合适的垃圾收集策略。</p>
            </div>
        </div>
    </section>

    <!-- Collectors Section -->
    <section class="py-12 px-4">
        <div class="container mx-auto max-w-6xl">
            <h2 class="text-3xl font-bold text-center mb-12 text-gray-800">主要垃圾收集器详解</h2>
            
            <!-- Serial GC -->
            <div class="mb-12 bg-white rounded-xl shadow-md overflow-hidden transition-all duration-300 card-hover">
                <div class="md:flex">
                    <div class="md:w-1/3 bg-red-50 p-6 flex items-center justify-center">
                        <div class="text-center">
                            <div class="icon-circle bg-red-100 text-red-600 mb-4">
                                <i class="fas fa-user feature-icon"></i>
                            </div>
                            <h3 class="text-xl font-bold text-gray-800">串行垃圾收集器</h3>
                            <p class="text-red-600 font-medium">Serial GC</p>
                        </div>
                    </div>
                    <div class="md:w-2/3 p-6 md:p-8">
                        <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                            <i class="fas fa-info-circle text-red-500 mr-2"></i> 特点
                        </h4>
                        <ul class="mb-6 pl-5 space-y-2">
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-red-500 mr-2 mt-1"></i>
                                <span><strong>单线程</strong>：使用单个线程进行垃圾收集操作，适用于单核处理器或低内存环境</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-red-500 mr-2 mt-1"></i>
                                <span><strong>简单高效</strong>：实现简单，开销低，但在多核处理器上性能不佳</span>
                            </li>
                        </ul>
                        
                        <div class="grid md:grid-cols-2 gap-6">
                            <div>
                                <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                                    <i class="fas fa-code-branch text-red-500 mr-2"></i> 类型
                                </h4>
                                <ul class="pl-5 space-y-2">
                                    <li class="flex items-start">
                                        <i class="fas fa-angle-right text-red-500 mr-2 mt-1"></i>
                                        <span><strong>串行新生代垃圾收集器</strong>：用于回收新生代的对象，适用于吞吐量较高的应用</span>
                                    </li>
                                    <li class="flex items-start">
                                        <i class="fas fa-angle-right text-red-500 mr-2 mt-1"></i>
                                        <span><strong>串行老年代垃圾收集器</strong>：用于回收老年代的对象，适用于小型应用程序或对停顿时间要求不高的场景</span>
                                    </li>
                                </ul>
                            </div>
                            <div>
                                <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                                    <i class="fas fa-cog text-red-500 mr-2"></i> 配置参数
                                </h4>
                                <div class="bg-gray-50 p-3 rounded-lg">
                                    <code class="text-sm text-gray-700">-XX:+UseSerialGC</code>
                                </div>
                                <p class="text-sm text-gray-500 mt-2">启用串行垃圾收集器</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- Parallel GC -->
            <div class="mb-12 bg-white rounded-xl shadow-md overflow-hidden transition-all duration-300 card-hover">
                <div class="md:flex">
                    <div class="md:w-1/3 bg-blue-50 p-6 flex items-center justify-center">
                        <div class="text-center">
                            <div class="icon-circle bg-blue-100 text-blue-600 mb-4">
                                <i class="fas fa-users feature-icon"></i>
                            </div>
                            <h3 class="text-xl font-bold text-gray-800">并行垃圾收集器</h3>
                            <p class="text-blue-600 font-medium">Parallel GC</p>
                        </div>
                    </div>
                    <div class="md:w-2/3 p-6 md:p-8">
                        <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                            <i class="fas fa-info-circle text-blue-500 mr-2"></i> 特点
                        </h4>
                        <ul class="mb-6 pl-5 space-y-2">
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-blue-500 mr-2 mt-1"></i>
                                <span><strong>多线程</strong>：使用多个线程并行进行垃圾收集，提高了在多核处理器上的性能</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-blue-500 mr-2 mt-1"></i>
                                <span><strong>吞吐量优先</strong>：设计目标是提高应用程序的吞吐量，即减少垃圾收集占用的时间</span>
                            </li>
                        </ul>
                        
                        <div class="grid md:grid-cols-2 gap-6">
                            <div>
                                <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                                    <i class="fas fa-code-branch text-blue-500 mr-2"></i> 类型
                                </h4>
                                <ul class="pl-5 space-y-2">
                                    <li class="flex items-start">
                                        <i class="fas fa-angle-right text-blue-500 mr-2 mt-1"></i>
                                        <span><strong>并行新生代垃圾收集器</strong>：用于并行回收新生代的对象，能够减少 GC 停顿时间</span>
                                    </li>
                                    <li class="flex items-start">
                                        <i class="fas fa-angle-right text-blue-500 mr-2 mt-1"></i>
                                        <span><strong>并行老年代垃圾收集器</strong>：用于并行回收老年代的对象，提高老年代的回收效率</span>
                                    </li>
                                </ul>
                            </div>
                            <div>
                                <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                                    <i class="fas fa-cog text-blue-500 mr-2"></i> 配置参数
                                </h4>
                                <div class="bg-gray-50 p-3 rounded-lg">
                                    <code class="text-sm text-gray-700">-XX:+UseParallelGC</code>
                                </div>
                                <p class="text-sm text-gray-500 mt-2">启用并行垃圾收集器</p>
                                <div class="bg-gray-50 p-3 rounded-lg mt-2">
                                    <code class="text-sm text-gray-700">-XX:ParallelGCThreads=N</code>
                                </div>
                                <p class="text-sm text-gray-500 mt-2">设置并行GC线程数</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- CMS GC -->
            <div class="mb-12 bg-white rounded-xl shadow-md overflow-hidden transition-all duration-300 card-hover">
                <div class="md:flex">
                    <div class="md:w-1/3 bg-purple-50 p-6 flex items-center justify-center">
                        <div class="text-center">
                            <div class="icon-circle bg-purple-100 text-purple-600 mb-4">
                                <i class="fas fa-bolt feature-icon"></i>
                            </div>
                            <h3 class="text-xl font-bold text-gray-800">并发标记-清除垃圾收集器</h3>
                            <p class="text-purple-600 font-medium">CMS GC</p>
                        </div>
                    </div>
                    <div class="md:w-2/3 p-6 md:p-8">
                        <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                            <i class="fas fa-info-circle text-purple-500 mr-2"></i> 特点
                        </h4>
                        <ul class="mb-6 pl-5 space-y-2">
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-purple-500 mr-2 mt-1"></i>
                                <span><strong>并发</strong>：在应用程序运行的同时进行垃圾收集，减少停顿时间</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-purple-500 mr-2 mt-1"></i>
                                <span><strong>低延迟</strong>：旨在减少应用程序的停顿时间，适用于低延迟的应用场景</span>
                            </li>
                        </ul>
                        
                        <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                            <i class="fas fa-sitemap text-purple-500 mr-2"></i> 处理过程
                        </h4>
                        <div class="mermaid mb-6">
                            graph LR
                            A[初始标记] -->|STW| B[并发标记]
                            B --> C[重新标记]
                            C -->|STW| D[并发清除]
                        </div>
                        
                        <div class="grid md:grid-cols-2 gap-6">
                            <div>
                                <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                                    <i class="fas fa-exclamation-triangle text-purple-500 mr-2"></i> 缺点
                                </h4>
                                <ul class="pl-5 space-y-2">
                                    <li class="flex items-start">
                                        <i class="fas fa-times-circle text-purple-500 mr-2 mt-1"></i>
                                        <span><strong>内存碎片</strong>：CMS 可能导致老年代的内存碎片问题</span>
                                    </li>
                                    <li class="flex items-start">
                                        <i class="fas fa-times-circle text-purple-500 mr-2 mt-1"></i>
                                        <span><strong>资源消耗</strong>：并发标记和清除需要额外的 CPU 资源</span>
                                    </li>
                                </ul>
                            </div>
                            <div>
                                <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                                    <i class="fas fa-cog text-purple-500 mr-2"></i> 配置参数
                                </h4>
                                <div class="bg-gray-50 p-3 rounded-lg">
                                    <code class="text-sm text-gray-700">-XX:+UseConcMarkSweepGC</code>
                                </div>
                                <p class="text-sm text-gray-500 mt-2">启用CMS垃圾收集器</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- G1 GC -->
            <div class="mb-12 bg-white rounded-xl shadow-md overflow-hidden transition-all duration-300 card-hover">
                <div class="md:flex">
                    <div class="md:w-1/3 bg-green-50 p-6 flex items-center justify-center">
                        <div class="text-center">
                            <div class="icon-circle bg-green-100 text-green-600 mb-4">
                                <i class="fas fa-chess-board feature-icon"></i>
                            </div>
                            <h3 class="text-xl font-bold text-gray-800">G1 垃圾收集器</h3>
                            <p class="text-green-600 font-medium">Garbage-First GC</p>
                        </div>
                    </div>
                    <div class="md:w-2/3 p-6 md:p-8">
                        <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                            <i class="fas fa-info-circle text-green-500 mr-2"></i> 特点
                        </h4>
                        <ul class="mb-6 pl-5 space-y-2">
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                                <span><strong>分区</strong>：将堆内存分为多个区域，根据优先级回收</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                                <span><strong>低停顿</strong>：通过精细控制回收过程，能够提供较低的停顿时间</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                                <span><strong>高效整理</strong>：解决了内存碎片问题，能够进行高效的内存整理</span>
                            </li>
                        </ul>
                        
                        <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                            <i class="fas fa-sitemap text-green-500 mr-2"></i> 处理过程
                        </h4>
                        <div class="mermaid mb-6">
                            graph TD
                            A[初始标记] -->|STW| B[并发标记]
                            B --> C[最终标记]
                            C -->|STW| D[回收]
                        </div>
                        
                        <div class="grid md:grid-cols-2 gap-6">
                            <div>
                                <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                                    <i class="fas fa-thumbs-up text-green-500 mr-2"></i> 优势
                                </h4>
                                <ul class="pl-5 space-y-2">
                                    <li class="flex items-start">
                                        <i class="fas fa-check text-green-500 mr-2 mt-1"></i>
                                        <span>适用于大内存堆</span>
                                    </li>
                                    <li class="flex items-start">
                                        <i class="fas fa-check text-green-500 mr-2 mt-1"></i>
                                        <span>可预测的停顿时间</span>
                                    </li>
                                    <li class="flex items-start">
                                        <i class="fas fa-check text-green-500 mr-2 mt-1"></i>
                                        <span>JDK 9+ 默认收集器</span>
                                    </li>
                                </ul>
                            </div>
                            <div>
                                <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                                    <i class="fas fa-cog text-green-500 mr-2"></i> 配置参数
                                </h4>
                                <div class="bg-gray-50 p-3 rounded-lg">
                                    <code class="text-sm text-gray-700">-XX:+UseG1GC</code>
                                </div>
                                <p class="text-sm text-gray-500 mt-2">启用G1垃圾收集器</p>
                                <div class="bg-gray-50 p-3 rounded-lg mt-2">
                                    <code class="text-sm text-gray-700">-XX:MaxGCPauseMillis=200</code>
                                </div>
                                <p class="text-sm text-gray-500 mt-2">设置最大GC停顿时间目标</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- ZGC -->
            <div class="mb-12 bg-white rounded-xl shadow-md overflow-hidden transition-all duration-300 card-hover">
                <div class="md:flex">
                    <div class="md:w-1/3 bg-yellow-50 p-6 flex items-center justify-center">
                        <div class="text-center">
                            <div class="icon-circle bg-yellow-100 text-yellow-600 mb-4">
                                <i class="fas fa-rocket feature-icon"></i>
                            </div>
                            <h3 class="text-xl font-bold text-gray-800">Z 垃圾收集器</h3>
                            <p class="text-yellow-600 font-medium">ZGC</p>
                        </div>
                    </div>
                    <div class="md:w-2/3 p-6 md:p-8">
                        <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                            <i class="fas fa-info-circle text-yellow-500 mr-2"></i> 特点
                        </h4>
                        <ul class="mb-6 pl-5 space-y-2">
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-yellow-500 mr-2 mt-1"></i>
                                <span><strong>极低延迟</strong>：设计目标是提供几乎零停顿的垃圾回收，适用于大规模内存应用</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-yellow-500 mr-2 mt-1"></i>
                                <span><strong>并发回收</strong>：几乎所有的垃圾回收操作都是并发进行的</span>
                            </li>
                        </ul>
                        
                        <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                            <i class="fas fa-sitemap text-yellow-500 mr-2"></i> 处理过程
                        </h4>
                        <div class="mermaid mb-6">
                            graph LR
                            A[并发标记] --> B[并发重定位]
                            B --> C[并发引用处理]
                        </div>
                        
                        <div class="grid md:grid-cols-2 gap-6">
                            <div>
                                <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                                    <i class="fas fa-exclamation-triangle text-yellow-500 mr-2"></i> 缺点
                                </h4>
                                <ul class="pl-5 space-y-2">
                                    <li class="flex items-start">
                                        <i class="fas fa-times-circle text-yellow-500 mr-2 mt-1"></i>
                                        <span><strong>高内存开销</strong>：需要更多的内存资源来支持高效的垃圾回收</span>
                                    </li>
                                    <li class="flex items-start">
                                        <i class="fas fa-times-circle text-yellow-500 mr-2 mt-1"></i>
                                        <span><strong>JDK 11+ 实验性</strong>：JDK 15 成为生产可用</span>
                                    </li>
                                </ul>
                            </div>
                            <div>
                                <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                                    <i class="fas fa-cog text-yellow-500 mr-2"></i> 配置参数
                                </h4>
                                <div class="bg-gray-50 p-3 rounded-lg">
                                    <code class="text-sm text-gray-700">-XX:+UseZGC</code>
                                </div>
                                <p class="text-sm text-gray-500 mt-2">启用Z垃圾收集器</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- Shenandoah GC -->
            <div class="bg-white rounded-xl shadow-md overflow-hidden transition-all duration-300 card-hover">
                <div class="md:flex">
                    <div class="md:w-1/3 bg-pink-50 p-6 flex items-center justify-center">
                        <div class="text-center">
                            <div class="icon-circle bg-pink-100 text-pink-600 mb-4">
                                <i class="fas fa-tachometer-alt feature-icon"></i>
                            </div>
                            <h3 class="text-xl font-bold text-gray-800">Shenandoah 垃圾收集器</h3>
                            <p class="text-pink-600 font-medium">Shenandoah GC</p>
                        </div>
                    </div>
                    <div class="md:w-2/3 p-6 md:p-8">
                        <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                            <i class="fas fa-info-circle text-pink-500 mr-2"></i> 特点
                        </h4>
                        <ul class="mb-6 pl-5 space-y-2">
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-pink-500 mr-2 mt-1"></i>
                                <span><strong>低停顿</strong>：旨在提供低停顿时间的垃圾回收，适用于低延迟应用</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-pink-500 mr-2 mt-1"></i>
                                <span><strong>并发回收</strong>：并发执行标记、整理和回收过程，减少停顿时间</span>
                            </li>
                        </ul>
                        
                        <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                            <i class="fas fa-sitemap text-pink-500 mr-2"></i> 处理过程
                        </h4>
                        <div class="mermaid mb-6">
                            graph LR
                            A[并发标记] --> B[并发整理]
                            B --> C[并发回收]
                        </div>
                        
                        <div class="grid md:grid-cols-2 gap-6">
                            <div>
                                <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                                    <i class="fas fa-thumbs-up text-pink-500 mr-2"></i> 优势
                                </h4>
                                <ul class="pl-5 space-y-2">
                                    <li class="flex items-start">
                                        <i class="fas fa-check text-pink-500 mr-2 mt-1"></i>
                                        <span>与ZGC类似的低延迟目标</span>
                                    </li>
                                    <li class="flex items-start">
                                        <i class="fas fa-check text-pink-500 mr-2 mt-1"></i>
                                        <span>由Red Hat贡献</span>
                                    </li>
                                    <li class="flex items-start">
                                        <i class="fas fa-check text-pink-500 mr-2 mt-1"></i>
                                        <span>JDK 12+ 可用</span>
                                    </li>
                                </ul>
                            </div>
                            <div>
                                <h4 class="text-lg font-semibold text-gray-800 mb-3 flex items-center">
                                    <i class="fas fa-cog text-pink-500 mr-2"></i> 配置参数
                                </h4>
                                <div class="bg-gray-50 p-3 rounded-lg">
                                    <code class="text-sm text-gray-700">-XX:+UseShenandoahGC</code>
                                </div>
                                <p class="text-sm text-gray-500 mt-2">启用Shenandoah垃圾收集器</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Comparison Section -->
    <section id="comparison" class="py-12 px-4 bg-gray-100">
        <div class="container mx-auto max-w-6xl">
            <h2 class="text-3xl font-bold text-center mb-12 text-gray-800">垃圾收集器对比</h2>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden">
                <div class="overflow-x-auto">
                    <table class="min-w-full divide-y divide-gray-200">
                        <thead class="bg-gray-50">
                            <tr>
                                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">收集器</th>
                                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">算法</th>
                                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">线程</th>
                                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">停顿时间</th>
                                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">吞吐量</th>
                                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">适用场景</th>
                            </tr>
                        </thead>
                        <tbody class="bg-white divide-y divide-gray-200">
                            <tr class="comparison-item hover:bg-gray-50">
                                <td class="px-6 py-4 whitespace-nowrap">
                                    <div class="flex items-center">
                                        <div class="flex-shrink-0 h-10 w-10 bg-red-100 rounded-full flex items-center justify-center">
                                            <i class="fas fa-user text-red-600"></i>
                                        </div>
                                        <div class="ml-4">
                                            <div class="text-sm font-medium text-gray-900">Serial GC</div>
                                        </div>
                                    </div>
                                </td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">标记-复制/标记-整理</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">单线程</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">高</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">中</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">单核CPU，小内存客户端</td>
                            </tr>
                            <tr class="comparison-item hover:bg-gray-50">
                                <td class="px-6 py-4 whitespace-nowrap">
                                    <div class="flex items-center">
                                        <div class="flex-shrink-0 h-10 w-10 bg-blue-100 rounded-full flex items-center justify-center">
                                            <i class="fas fa-users text-blue-600"></i>
                                        </div>
                                        <div class="ml-4">
                                            <div class="text-sm font-medium text-gray-900">Parallel GC</div>
                                        </div>
                                    </div>
                                </td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">标记-复制/标记-整理</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">多线程</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">中</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">高</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">多核CPU，吞吐量优先</td>
                            </tr>
                            <tr class="comparison-item hover:bg-gray-50">
                                <td class="px-6 py-4 whitespace-nowrap">
                                    <div class="flex items-center">
                                        <div class="flex-shrink-0 h-10 w-10 bg-purple-100 rounded-full flex items-center justify-center">
                                            <i class="fas fa-bolt text-purple-600"></i>
                                        </div>
                                        <div class="ml-4">
                                            <div class="text-sm font-medium text-gray-900">CMS</div>
                                        </div>
                                    </div>
                                </td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">标记-清除</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">多线程并发</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">低</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">中</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">老年代低延迟应用</td>
                            </tr>
                            <tr class="comparison-item hover:bg-gray-50">
                                <td class="px-6 py-4 whitespace-nowrap">
                                    <div class="flex items-center">
                                        <div class="flex-shrink-0 h-10 w-10 bg-green-100 rounded-full flex items-center justify-center">
                                            <i class="fas fa-chess-board text-green-600"></i>
                                        </div>
                                        <div class="ml-4">
                                            <div class="text-sm font-medium text-gray-900">G1</div>
                                        </div>
                                    </div>
                                </td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">标记-整理+分区</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">多线程并发</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">可预测</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">高</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">大内存堆，平衡需求</td>
                            </tr>
                            <tr class="comparison-item hover:bg-gray-50">
                                <td class="px-6 py-4 whitespace-nowrap">
                                    <div class="flex items-center">
                                        <div class="flex-shrink-0 h-10 w-10 bg-yellow-100 rounded-full flex items-center justify-center">
                                            <i class="fas fa-rocket text-yellow-600"></i>
                                        </div>
                                        <div class="ml-4">
                                            <div class="text-sm font-medium text-gray-900">ZGC</div>
                                        </div>
                                    </div>
                                </td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">指针标记+着色</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">多线程并发</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">极低</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">中高</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">大内存，极低延迟</td>
                            </tr>
                            <tr class="comparison-item hover:bg-gray-50">
                                <td class="px-6 py-4 whitespace-nowrap">
                                    <div class="flex items-center">
                                        <div class="flex-shrink-0 h-10 w-10 bg-pink-100 rounded-full flex items-center justify-center">
                                            <i class="fas fa-tachometer-alt text-pink-600"></i>
                                        </div>
                                        <div class="ml-4">
                                            <div class="text-sm font-medium text-gray-900">Shenandoah</div>
                                        </div>
                                    </div>
                                </td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">并发标记-整理</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">多线程并发</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">极低</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">中高</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">大内存，低延迟</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </section>

    <!-- Timeline Section -->
    <section id="timeline" class="py-12 px-4">
        <div class="container mx-auto max-w-6xl">
            <h2 class="text-3xl font-bold text-center mb-12 text-gray-800">垃圾收集器发展历程</h2>
            
            <div class="relative timeline">
                <!-- Timeline Item 1 -->
                <div class="mb-12 md:flex justify-center">
                    <div class="md:w-5/12 md:pr-8 md:text-right">
                        <div class="p-6 bg-white rounded-lg shadow-md">
                            <h3 class="text-xl font-bold text-gray-800 mb-2">Serial GC (JDK 1.3)</h3>
                            <p class="text-gray-600">最初的垃圾收集器，单线程工作，适用于单核CPU环境</p>
                        </div>
                    </div>
                    <div class="hidden md:block md:w-2/12"></div>
                    <div class="hidden md:block md:w-5/12"></div>
                    <div class="timeline-dot bg-red-500"></div>
                </div>
                
                <!-- Timeline Item 2 -->
                <div class="mb-12 md:flex justify-center">
                    <div class="hidden md:block md:w-5/12"></div>
                    <div class="hidden md:block md:w-2/12"></div>
                    <div class="md:w-5/12 md:pl-8">
                        <div class="p-6 bg-white rounded-lg shadow-md">
                            <h3 class="text-xl font-bold text-gray-800 mb-2">Parallel GC (JDK 1.4)</h3>
                            <p class="text-gray-600">引入多线程并行收集，提高吞吐量</p>
                        </div>
                    </div>
                    <div class="timeline-dot bg-blue-500"></div>
                </div>
                
                <!-- Timeline Item 3 -->
                <div class="mb-12 md:flex justify-center">
                    <div class="md:w-5/12 md:pr-8 md:text-right">
                        <div class="p-6 bg-white rounded-lg shadow-md">
                            <h3 class="text-xl font-bold text-gray-800 mb-2">CMS (JDK 1.4.2)</h3>
                            <p class="text-gray-600">首个并发收集器，减少停顿时间</p>
                        </div>
                    </div>
                    <div class="hidden md:block md:w-2/12"></div>
                    <div class="hidden md:block md:w-5/12"></div>
                    <div class="timeline-dot bg-purple-500"></div>
                </div>
                
                <!-- Timeline Item 4 -->
                <div class="mb-12 md:flex justify-center">
                    <div class="hidden md:block md:w-5/12"></div>
                    <div class="hidden md:block md:w-2/12"></div>
                    <div class="md:w-5/12 md:pl-8">
                        <div class="p-6 bg-white rounded-lg shadow-md">
                            <h3 class="text-xl font-bold text-gray-800 mb-2">G1 (JDK 7u4)</h3>
                            <p class="text-gray-600">分区收集器，平衡吞吐量和延迟</p>
                        </div>
                    </div>
                    <div class="timeline-dot bg-green-500"></div>
                </div>
                
                <!-- Timeline Item 5 -->
                <div class="mb-12 md:flex justify-center">
                    <div class="md:w-5/12 md:pr-8 md:text-right">
                        <div class="p-6 bg-white rounded-lg shadow-md">
                            <h3 class="text-xl font-bold text-gray-800 mb-2">Shenandoah (JDK 12)</h3>
                            <p class="text-gray-600">Red Hat开发的低延迟收集器</p>
                        </div>
                    </div>
                    <div class="hidden md:block md:w-2/12"></div>
                    <div class="hidden md:block md:w-5/12"></div>
                    <div class="timeline-dot bg-pink-500"></div>
                </div>
                
                <!-- Timeline Item 6 -->
                <div class="md:flex justify-center">
                    <div class="hidden md:block md:w-5/12"></div>
                    <div class="hidden md:block md:w-2/12"></div>
                    <div class="md:w-5/12 md:pl-8">
                        <div class="p-6 bg-white rounded-lg shadow-md">
                            <h3 class="text-xl font-bold text-gray-800 mb-2">ZGC (JDK 11)</h3>
                            <p class="text-gray-600">可扩展的低延迟收集器，支持TB级堆</p>
                        </div>
                    </div>
                    <div class="timeline-dot bg-yellow-500"></div>
                </div>
            </div>
        </div>
    </section>

    <!-- Selection Guide Section -->
    <section class="py-12 px-4 bg-gray-100">
        <div class="container mx-auto max-w-6xl">
            <h2 class="text-3xl font-bold text-center mb-12 text-gray-800">如何选择合适的垃圾收集器</h2>
            
            <div class="grid md:grid-cols-3 gap-8">
                <div class="bg-white rounded-xl shadow-md p-6 transition-all duration-300 hover:shadow-lg">
                    <div class="text-indigo-600 text-4xl mb-4">
                        <i class="fas fa-tachometer-alt"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3 text-gray-800">关注吞吐量</h3>
                    <p class="text-gray-600">如果你的应用需要最大化的处理能力，不介意偶尔的较长停顿：</p>
                    <ul class="mt-3 pl-5 space-y-2 text-gray-600">
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mr-2 mt-1"></i>
                            <span>Parallel GC (默认)</span>
                        </li>
                    </ul>
                </div>
                
                <div class="bg-white rounded-xl shadow-md p-6 transition-all duration-300 hover:shadow-lg">
                    <div class="text-indigo-600 text-4xl mb-4">
                        <i class="fas fa-clock"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3 text-gray-800">关注延迟</h3>
                    <p class="text-gray-600">如果你的应用对响应时间敏感，需要最小化GC停顿：</p>
                    <ul class="mt-3 pl-5 space-y-2 text-gray-600">
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mr-2 mt-1"></i>
                            <span>G1 GC (JDK 9+ 默认)</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mr-2 mt-1"></i>
                            <span>ZGC (大内存堆)</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mr-2 mt-1"></i>
                            <span>Shenandoah</span>
                        </li>
                    </ul>
                </div>
                
                <div class="bg-white rounded-xl shadow-md p-6 transition-all duration-300 hover:shadow-lg">
                    <div class="text-indigo-600 text-4xl mb-4">
                        <i class="fas fa-server"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3 text-gray-800">特殊场景</h3>
                    <p class="text-gray-600">根据特定需求选择：</p>
                    <ul class="mt-3 pl-5 space-y-2 text-gray-600">
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mr-2 mt-1"></i>
                            <span>小型应用：Serial GC</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mr-2 mt-1"></i>
                            <span>老版本应用：CMS (JDK 14+已移除)</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mr-2 mt-1"></i>
                            <span>云原生/微服务：G1 或 ZGC</span>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </section>

    <!-- Footer -->
    <footer class="bg-gray-900 text-white py-8 px-4">
        <div class="container mx-auto max-w-6xl">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-bold">技术小馆</h3>
                    <p class="text-gray-400 mt-1">探索技术之美，品味代码之趣</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-gray-300 hover:text-white transition duration-300">
                        <i class="fas fa-globe mr-2"></i> http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
            <div class="mt-8 pt-6 border-t border-gray-800 text-center text-gray-400 text-sm">
                © 2023 技术小馆. 版权所有.
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>
```